<?php

/**
 * Inscription filter form base class.
 *
 * @package    tfe
 * @subpackage filter
 * @author     3emeIG
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInscriptionFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_contact'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'add_empty' => true)),
      'id_groupe'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Groupe'), 'add_empty' => true)),
      'parent'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Parent'), 'add_empty' => true)),
      'prix'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'mode_de_paiement' => new sfWidgetFormChoice(array('choices' => array('' => '', 'liquide' => 'liquide', 'virement' => 'virement', 'carte' => 'carte', 'chèque' => 'chèque'))),
      'date_de_paiement' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'code_de_paiement' => new sfWidgetFormFilterInput(),
      'validee'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'annulee'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'expiree'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'a_rembourser'     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'remboursee'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'commentaire'      => new sfWidgetFormFilterInput(),
      'deleted_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'created_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'id_contact'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Contact'), 'column' => 'id')),
      'id_groupe'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Groupe'), 'column' => 'id')),
      'parent'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Parent'), 'column' => 'id')),
      'prix'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'mode_de_paiement' => new sfValidatorChoice(array('required' => false, 'choices' => array('' => '', 'liquide' => 'liquide', 'virement' => 'virement', 'carte' => 'carte', 'chèque' => 'chèque'))),
      'date_de_paiement' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'code_de_paiement' => new sfValidatorPass(array('required' => false)),
      'validee'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'annulee'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'expiree'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'a_rembourser'     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'remboursee'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'commentaire'      => new sfValidatorPass(array('required' => false)),
      'deleted_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'created_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('inscription_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Inscription';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'id_contact'       => 'ForeignKey',
      'id_groupe'        => 'ForeignKey',
      'parent'           => 'ForeignKey',
      'prix'             => 'Number',
      'mode_de_paiement' => 'Enum',
      'date_de_paiement' => 'Date',
      'code_de_paiement' => 'Text',
      'validee'          => 'Boolean',
      'annulee'          => 'Boolean',
      'expiree'          => 'Boolean',
      'a_rembourser'     => 'Boolean',
      'remboursee'       => 'Boolean',
      'commentaire'      => 'Text',
      'deleted_at'       => 'Date',
      'created_at'       => 'Date',
      'updated_at'       => 'Date',
    );
  }
}
